package com.version.manager.rabbitmq;

import com.version.manager.entity.Shop.shopCar;
import com.version.manager.util.JsonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MQSender {

    private static Logger log= LoggerFactory.getLogger(MQSender.class);
    @Autowired
    AmqpTemplate amqpTemplate;


    public void send(String queueName,Object data){
        String str= JsonUtil.objToJson(data);
        amqpTemplate.convertAndSend(queueName,str);
    }

//    public void send(Object message){
//        amqpTemplate.convertAndSend(MQConfig.QUEUE,message);
//        amqpTemplate.convertAndSend(MQConfig.TOPIC_QUEUE1,message);
//        amqpTemplate.convertAndSend(MQConfig.TOPIC_QUEUE2,message);
//        amqpTemplate.convertAndSend(MQConfig.FANOUT_EXCHANGE,"","fant");
//    }
}
